package com.xuzao.developer.redisson;

import org.redisson.api.RLock;

import java.util.concurrent.TimeUnit;

/**
 * redisson lock service
 *
 * @author caorui
 * @date 2019年02月21日 10:36:25
 */
public interface DistributedLocker {

    RLock lock(String lockKey);

    RLock lock(String lockKey, int timeout);

    RLock lock(String lockKey, TimeUnit unit, int timeout);

    boolean tryLock(String lockKey, TimeUnit unit, int waitTime, int leaseTime);

    void unlock(String lockKey);

    void unlock(RLock lock);
}